﻿namespace HRM.CORE.Process
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms; using Common;

    public class xfmRate : XtraForm
    {
        private IContainer components;
        public DevExpress.Utils.ImageCollection imageCollection2;
        private string m_EmployeeCode;
        private int m_FromMonth;
        private int m_ToMonth;
        private int m_Year;

        public xfmRate()
        {
            this.m_EmployeeCode = "";
            this.m_FromMonth = 0;
            this.m_ToMonth = 0;
            this.m_Year = 0;
            this.components = null;
            this.InitializeComponent();
        }

        public xfmRate(string EmployeeCode, int FromMonth, int ToMonth, int Year)
        {
            this.m_EmployeeCode = "";
            this.m_FromMonth = 0;
            this.m_ToMonth = 0;
            this.m_Year = 0;
            this.components = null;
            this.InitializeComponent();
            this.m_EmployeeCode = EmployeeCode;
            this.m_FromMonth = FromMonth;
            this.m_ToMonth = ToMonth;
            this.m_Year = Year;
            base.Load += new EventHandler(this.xfmRate_Load);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmRate));
            this.imageCollection2 = new DevExpress.Utils.ImageCollection(this.components);
            this.imageCollection2.BeginInit();
            base.SuspendLayout();
            this.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x330, 0x221);
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "xfmRate";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Kết quả đ\x00e1nh gi\x00e1, xếp loại nh\x00e2n vi\x00ean";
            this.imageCollection2.EndInit();
            base.ResumeLayout(false);
        }

        private void xfmRate_Load(object sender, EventArgs e)
        {
            xucRate rate = new xucRate();
            DateTime time = new DateTime(this.m_Year, this.m_ToMonth, 1);
            DateTime endDate = time.AddMonths(1).AddDays(-1.0);
            rate.Dock = DockStyle.Fill;
            string[] strArray = new string[] { this.Text, " - Từ ", new DateTime(this.m_Year, this.m_FromMonth, 1).ToShortDateString(), " đến ", endDate.ToShortDateString() };
            this.Text = string.Concat(strArray);
            base.Controls.Add(rate);
            rate.SetData(this.m_EmployeeCode, new DateTime(this.m_Year, this.m_FromMonth, 1), endDate);
        }
    }
}

